﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StudentClasses.aspx.cs" Inherits="School.Pages.Admission.StudentClasses" MasterPageFile="~/MasterALSafa.Master" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
<div align="center" dir="rtl">

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
        <asp:Panel ID="pnlAdd" runat="server" Visible="false">
            <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td colspan="2" class="admintitle">
                        جدول اختبار القبول للطلبة</td>
                </tr>
                <tr>
                    <td style="width: 160px; text-align: right;">
                        <asp:Label ID="Label1" runat="server" CssClass="ItemStyle"  Text="المجمع"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:DropDownList ID="ddlcampus_Id" runat="server" AutoPostBack="True" 
                            onselectedindexchanged="ddlcampus_Id_SelectedIndexChanged" Width="200px">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td style="width: 160px; text-align: right;">
                        <asp:Label ID="lblCertificate_Id" runat="server" CssClass="lab" 
                            Text="نوع الشهادة"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:DropDownList ID="ddlCertificate_Id" runat="server" AutoPostBack="True" 
                            onselectedindexchanged="ddlCertificate_Id_SelectedIndexChanged" 
                            Enabled="False" Width="200px">
                        </asp:DropDownList>

                    </td>
                </tr>
                <tr>
                    <td style="width: 160px; text-align: right;">
                        <asp:Label ID="lblStage_Id" runat="server" CssClass="lab" Text="مرحلة القيد"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:DropDownList ID="ddlStage_Id" runat="server" AutoPostBack="True" 
                            onselectedindexchanged="ddlStage_Id_SelectedIndexChanged" Enabled="False" 
                            style="height: 22px" Width="200px">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td style="width: 160px; text-align: right;">
                        <asp:Label ID="lblClass_Id" runat="server" Text="الصف" CssClass="lab"></asp:Label>
                    </td>
                    <td align="right" >
                        <asp:DropDownList ID="ddlGrade_Id" runat="server" AutoPostBack="True" 
                            Height="27px" Enabled="False" 
                            onselectedindexchanged="ddlGrade_Id_SelectedIndexChanged" Width="200px">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td style="width: 160px; text-align: right;">
                        السنة الدراسية</td>
                    <td align="right" >
                        <asp:DropDownList ID="ddlEductionalYear_Id" runat="server" AutoPostBack="True" 
                            Enabled="False" Height="26px" 
                            onselectedindexchanged="ddlEductionalYear_Id_SelectedIndexChanged" 
                            Width="200px">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td style="width: 160px; text-align: right;">
                        <asp:Label ID="Label19" runat="server" CssClass="lab" Text="الفصول"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:ListBox ID="ddlClass_Id" runat="server" Enabled="False" Rows="3">
                        </asp:ListBox>
                        <asp:Label ID="lblTeacherCount" runat="server" CssClass="lab" Text="الفصول" 
                            Visible="False"></asp:Label>
                    </td>
                </tr>
                
                
                <tr>
                    <td style="width: 160px; text-align: right;">
                        <asp:Label ID="Label21" runat="server" CssClass="lab" Text="عدد الطلبة"></asp:Label>
                    </td>
                    <td align="right">
                        <asp:Label ID="lblStudentCount" runat="server" CssClass="lab" Text="طالب" 
                            Visible="False"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td style="width: 160px">
                        &nbsp;</td>
                    <td align="right">
                        <asp:RadioButtonList ID="rblSearchType" runat="server" 
                            RepeatDirection="Horizontal">
                            <asp:ListItem Selected="True" Text="ابجديا" Value="0"></asp:ListItem>
                            <asp:ListItem Text="تاريخ الميلاد" Value="1"></asp:ListItem>
                            <asp:ListItem Text="النوع" Value="2"></asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                
                
                <tr>
                    <td colspan="2">
                        <asp:Label ID="lblMessageAdd" runat="server" CssClass="error"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Button ID="btnSave" runat="server" CssClass="graybutton" 
                            OnClick="btnSave_Click" Text="عمل الجدول" />

                        &nbsp;<asp:Button ID="btnCancel" runat="server" CssClass="graybutton" CausesValidation="False"
                            OnClick="btnCancel_Click" Text="تفريغ الحقول" />
                        &nbsp;<asp:Button ID="btnend" runat="server" CssClass="graybutton" CausesValidation="False"
                            OnClick="btnend_Click" Text="انهاء" />
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    <br />
    <div align="center">
        <asp:Panel ID="pnlbrows" runat="server" Visible="true">
            <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td colspan="2" class="admintitle">
                        عرض البيانات
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <table width="90%" align="center" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td style="width: 99px; text-align: right;">
                                    <asp:Label ID="Label15" runat="server" CssClass="lab" 
                                        Text="المجمع"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:DropDownList ID="ddlSearchcampus_Id" runat="server" AutoPostBack="True" 
                                        onselectedindexchanged="ddlSearchcampus_Id_SelectedIndexChanged" 
                                        Width="199px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 99px; text-align: right;">
                                    <asp:Label ID="lblCertificate_Id0" runat="server" CssClass="lab" 
                                        Text="نوع الشهادة"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:DropDownList ID="ddlSearchCertificate_Id" runat="server" 
                                        AutoPostBack="True" Enabled="False" 
                                        onselectedindexchanged="ddlSearchCertificate_Id_SelectedIndexChanged" 
                                        Width="200px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 99px; text-align: right;">
                                    <asp:Label ID="lblStage_Id0" runat="server" CssClass="lab" Text="مرحلة القيد"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:DropDownList ID="ddlSearchStage_Id" runat="server" AutoPostBack="True" 
                                        Enabled="False" 
                                        onselectedindexchanged="ddlSearchStage_Id_SelectedIndexChanged" 
                                        Width="200px">
                                    </asp:DropDownList>
                                   
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 99px; text-align: right;">
                                    <asp:Label ID="lblGrade_Id0" runat="server" CssClass="lab" Text="الصف"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:DropDownList ID="ddlSearchGrade_ID" runat="server" AutoPostBack="True" 
                                        Enabled="False" 
                                        onselectedindexchanged="ddlSearchGrade_ID_SelectedIndexChanged" Width="200px">
                                    </asp:DropDownList>
                                 
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 99px; text-align: right;">
                                    السنة الدراسية</td>
                                <td align="right">
                                    <asp:DropDownList ID="ddlSearchEductionalYear_Id" runat="server" 
                                        AutoPostBack="True" Width="200px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 99px; text-align: right;">
                                    <asp:Label ID="Label20" runat="server" CssClass="lab" Text="الفصل"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:DropDownList ID="ddlSearchClass_Id" runat="server" AutoPostBack="True" 
                                        Width="200px" >
                                    </asp:DropDownList>
                                    &nbsp;<asp:Button ID="btnReport" runat="server" CssClass="graybutton" 
                                        OnClick="btnReport_Click" Text="كشف الطلاب في الفصل" />
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: center;" colspan="2">
                                    <asp:Button ID="btnSearch" runat="server" CssClass="graybutton" 
                                        OnClick="btnSearch_Click" Text="بحث" />
                                    &nbsp;<asp:Button ID="btnAdd" runat="server" CssClass="graybutton" 
                                        OnClick="btnAdd_Click" Text="عمل قائمة الفصول" />
                                    &nbsp;<asp:Button ID="btnGetAll" runat="server" CssClass="graybutton" 
                                        OnClick="btnGetAll_Click" Text="الكل" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" style="text-align: right">
                                    <asp:Label CssClass="lableface" ID="lblRecordNo" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:GridView Width="100%" AllowPaging="True" AllowSorting="True" ID="griddata" runat="server"
                                        CssClass="Grid" HeaderStyle-CssClass="GridHeaderFooter" FooterStyle-CssClass="GridHeaderFooter"
                                        PagerStyle-CssClass="GridPager" 
                                        AlternatingRowStyle-CssClass="GridItemAltername" 
                                        AutoGenerateColumns="False" 
                                        onselectedindexchanged="griddata_SelectedIndexChanged" 
                                        OnRowDeleting="griddata_RowDeleting" DataKeyNames="Id" 
                                        onrowdatabound="griddata_RowDataBound" 
                                        onpageindexchanging="griddata_PageIndexChanging">
                                        <AlternatingRowStyle CssClass="GridItemAltername" />
                                        <Columns>
                                            <asp:TemplateField HeaderText="المجمع">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblCampus" runat="server" 
                                                        Text='<%# Eval("TE_Student.ORG_Campus.Name").ToString() %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="الشهادة">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblCertifcate" runat="server" 
                                                        Text='<%# Eval("TE_Student.ORG_Certificate.Name").ToString() %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="المرحلة">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblStage" runat="server" 
                                                        Text='<%# Eval("TE_Student.ORG_Stage.Name").ToString() %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="الصف">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblGrade" runat="server" 
                                                        Text='<%# Eval("TE_Student.ORG_Grade.Name").ToString() %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="الفصل">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblClass" runat="server" 
                                                        Text='<%# Eval("ORG_Class.Description").ToString() %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="الاسم الكامل">
                                                <ItemTemplate>
                                                    <asp:Label ID="Label1" runat="server" 
                                                        Text='<%# Eval("TE_Student.Ar_FirstName").ToString() + " " + Eval("TE_Student.Ar_SecondName").ToString() + " " + Eval("TE_Student.Ar_ThirdNmae").ToString()+ " " + Eval("TE_Student.Ar_FourthName").ToString() %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField ShowHeader="False">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                                        CommandName="Delete" Text="Delete"></asp:LinkButton>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                        <FooterStyle CssClass="GridHeaderFooter" />
                                        <HeaderStyle CssClass="GridHeaderFooter" />
                                        <PagerStyle CssClass="GridPager" />
                                    </asp:GridView>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:Label CssClass="error" ID="lblMessage" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    <br />
    
    <asp:Panel ID="pnldetails" runat="server" Visible="false">

                                    
            <table align="center" cellpadding="0" cellspacing="0" border="0" width="90%" dir="rtl">
             
                <tr>
                    <td>
                        <asp:DetailsView Width="100%" ID="DetViewdata" runat="server" AlternatingRowStyle-CssClass="GridItemAltername"
                            CssClass="Grid" HeaderStyle-CssClass="GridHeaderFooter" 
                            HeaderStyle-Width="30%" AutoGenerateRows="False">
                            <AlternatingRowStyle CssClass="GridItemAltername" />
                            <Fields>                                            
                            <asp:TemplateField HeaderText="المجمع">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblCampus" runat="server" Text='<%# Eval("TE_Student.ORG_Campus.Name").ToString() %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="الشهادة">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblCertifcate" runat="server" Text='<%# Eval("TE_Student.ORG_Certificate.Name").ToString() %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="المرحلة">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblStage" runat="server" Text='<%# Eval("TE_Student.ORG_Stage.Name").ToString() %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="الصف">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblGrade" runat="server" Text='<%# Eval("TE_Student.ORG_Grade.Name").ToString() %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            
                            </Fields>
                            <HeaderStyle CssClass="GridHeaderFooter" Width="30%" />
                        </asp:DetailsView>
                    </td>
                </tr>
                
                
        <tr>
        <td>
            <input type="button" value="رجوع" onclick="history.go(-1)" class="graybutton" />
            </td>
        
        </tr>
                        
                        
        </table>            
        </asp:Panel>
        
        <asp:Panel ID="PnlResults" runat="server" Visible="false"> 
        <table cellpadding="0" cellspacing="0" border="0" width="90%" dir="rtl">
        <tr>
        <td>
            <rsweb:ReportViewer ID="rvstudent_Class" runat="server" Font-Names="Verdana" 
                Font-Size="8pt" Height="" InteractiveDeviceInfos="(Collection)" 
                SizeToReportContent="True" WaitMessageFont-Names="Verdana" 
                WaitMessageFont-Size="14pt" Width="100%">
                <localreport reportpath="Admission\Reports\rptStudentClass.rdlc">
                    <datasources>
                        <rsweb:ReportDataSource DataSourceId="EntityDataSource2" Name="DataSet1" />
                    </datasources>
                </localreport>
            </rsweb:ReportViewer>
            <asp:EntityDataSource ID="EntityDataSource2" runat="server" 
                ConnectionString="name=SchoolEntities" DefaultContainerName="SchoolEntities" 
                EnableFlattening="False" EntitySetName="vw_StudentClass">
            </asp:EntityDataSource>
        </td>
        </tr>
        </table>
    </asp:Panel>
</asp:Content>
